<?

$domain_name = $GLOBALS['domain_name'];
$domain_action = $GLOBALS['domain_action'];
$username = $GLOBALS['userName'];
$domainname = $GLOBALS['domainname'];

$p1 = $GLOBALS['dns_products']->product[($GLOBALS['rp_products']['p1'])];
$p2 = $GLOBALS['dns_products']->product[($GLOBALS['rp_products']['p2'])];
$p3 = $GLOBALS['dns_products']->product[($GLOBALS['rp_products']['p3'])];

$domain_list = list_reseller_domains_($GLOBALS['id']);
foreach($domain_list as $dom=>$arr){
	if($arr['dns_purchase_id']){
		$private_dns = true;
		break;
	}
}

?>
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
   <td align="left"><strong>Domain look-up, Registration or Transfer</strong></td>
   <td align="right"><a href="domain/faq.html?tab=mail_cluster" target="_blank">Help/ F.A.Q.</a></td>
   <td align="right"><a href="domain/faq.html?tab=tutorials" target="_blank">Tutorials</a></td>
 </tr>
</table>
<table class="reg_table" width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td align="center"><img src="domain/images/ico_step_2_2.gif" alt="Step 2"></td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
 </tr>
 <tr>
   <td align="center"><img src="domain/images/ico_completed_step.gif" alt="Step Completed" width="37" height="36"></td>
   <td align="left">Search</td>
   <td align="center"><img src="domain/images/ico_current_step.gif" alt="Current Step" width="37" height="36"></td>
   <td align="left">Set Purpose</td>
   <td align="center"><img src="domain/images/ico_next_step.gif" alt="Next Step" width="37" height="36"></td>
   <td align="left">Mailbox</td>
   <td align="center"><img src="domain/images/ico_next_step.gif" alt="Next Step" width="37" height="36"></td>
   <td align="left">Whois</td>
   <td align="center"><img src="domain/images/ico_next_step.gif" alt="Next Step" width="37" height="36"></td>
   <td align="left">Payment</td>
 </tr>
</table>
<br /><br />
<div style="background-color:#DCDCDC;padding-top:3px;padding-bottom:3px;padding-left:10px;">&nbsp;&nbsp;<strong><strong class="red">STEP 2</strong>: Choose the exact purpose of <? echo $domain_name; ?></strong></div>
<?php // by paz - patch za razlichni tekstove v zavisimost ot tova dali reseller-a ima cluster ili ne
if (!$private_dns) {
	if ($domain_action == 'available') {?>
	<p>Your domain <b><? echo $domain_name; ?></b> can be used by all your clients as:</p>
	<ol type="1">
	<li> DNS (i.e. ns1.<? echo $domain_name; ?>, ns2.<? echo $domain_name; ?>) for resolving their domains, regardless of the server on which they are hosted;</li>
	<li> SMTP/POP3/IMAP mail server (i.e. mail.<? echo $domain_name; ?>) for all e-mail boxes of your clients;</li>
	</ol>
	<p>Besides those options, you may use <b><? echo $domain_name; ?></b> as your online hosting store, instead of the supplied free link, i.e. both www.duoservers.com/?r=<? echo $username; ?> and <?=$domain_name;?>  will open the template of your choice.</p>
<? }  else { ?>
	<p>&nbsp;&nbsp;After the transfer of your domain name has been successfully completed, we provide the opportunity your domain <b><? echo $domain_name; ?></b> to be used by all your clients as:</p>
<ol type="1">
   <li>DNS (i.e. ns1.<? echo $domain_name; ?>, ns2.<? echo $domain_name; ?>) for resolving their domains, regardless of the server on which they are hosted;</li>
   <li>SMTP/POP3/IMAP mail server (i.e. mail.<? echo $domain_name; ?>) for all e-mail boxes of your clients;</li>
   <li>For hosting your template instead of the supplied free link to your store (both www.duoservers.com/?r=<? echo $username; ?> and <? echo $domain_name; ?> will open the <a href='<? echo "http://www.$domainname/?r=$username"; ?>'>template</a> of your choice);</li>
</ol>
<? }
} else {
	?>
	<p>As you have already purchased a Private DNS package, the domain name <strong><?=$domain_name;?></strong>, which you'd like to register/transfer now, can be used only to lead customers to the template of your choice.</b>
	<?
} // end paz ?>

<br />
<table class="marketing_tip" width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
   <th colspan="2" class="marketing_head" align="left">&nbsp;&nbsp;Marketing Tip</th>
 </tr>
 <tr>
   <td width="50" align="center" bgcolor="fffee8"><img src="domain/images/ico_marketing_tip.gif" alt="Marketing Tip" width="36" height="41"></td>
   <td bgcolor="fffee8">According to our researches, for your clients' convenience you'd better use your store's domain <b><? echo $domain_name; ?></b> as a DNS and as an SMTP/POP3/IMAP mail server.</td>
 </tr>
</table>
<br /><br />
<form name='sform' id='sform' onSubmit='return false;'>
   <div style="padding-left:20px;"><br />
       <table border="0" cellspacing="0" cellpadding="0"><tr><td>

<? if(!$private_dns and $domain_action != 'notavailable'){ ?>
       <table class="selected_dns" id="tbl_p1" width="250" border="0" cellspacing="0" cellpadding="0">
         <tr onClick="document.getElementById('products1').click();">
           <td width="20" align="center"><input type='radio' id='products1' name='products' value='p1' onClick="show_ns_type(this.id);selected_ns(this);show_ns_tooltip(this.value);"></td>
           <td><strong class="red"><? echo $p1->name; ?></strong> @ <strong>$<? echo sprintf("%01.2f", $p1->getPriceByType()); ?></strong>/year
               <span class="grey"><br />(Dedicated IP for DNS1)<br />(Shared IP for DNS2)</span></td>
         </tr>
       </table>
       <br />
       <table class="notselected_dns" id="tbl_p2" width="250" border="0" cellspacing="0" cellpadding="0">
         <tr onClick="document.getElementById('products2').click();">
           <td width="20" align="center"><input type='radio' id='products2' name='products' value='p2' onClick="show_ns_type(this.id);selected_ns(this);show_ns_tooltip(this.value);"></td>
           <td><strong class="red"><? echo $p2->name; ?></strong> @ <strong>$<? echo sprintf("%01.2f", $p2->getPriceByType()); ?></strong>/year
               <span class="grey"><br />(Dedicated IP for DNS1)<br />(Dedicated IP for DNS2)</span></td>
         </tr>
       </table>
<? } ?>
<? if(!in_array($domain_action, array('addmdns1','addmdns2'))){ ?>
       <br />
       <table class="notselected_dns" id="tbl_p3"  width="250" border="0" cellspacing="0" cellpadding="0">
         <tr onClick="document.getElementById('products3').click();">
           <td width="20" align="center"><input type='radio' id='products3' name='products' value='p3' onClick="show_ns_type(this.id);selected_ns(this);show_ns_tooltip(this.value);"></td>
           <?php // patch by paz - if action is registration or transfer
           if ($domain_action == 'available') {
           	$sole_action = 'Registration';
           } else {
           	$sole_action = 'Transfer';
           } // end paz?>
           <td>Sole Domain <?=$sole_action;?> @ <strong>$<? echo sprintf("%01.2f", $p3->getPriceByType()); ?></strong>/year</td>
         </tr>
       </table>
<? } ?>
       </td><td>
       <div id='mngdns' style='display:none'>
           <table class="selected_dns" width="260" border="0" cellspacing="0" cellpadding="0">
             <tr>
               <td align="justify" style="padding-left:8px;padding-top:8px;padding-bottom:8px;"><strong>Having a Private DNS increases your reseller anonymity. Choose one of the following options (we suggest the first option, which offers everything under one single brand name):</strong>
               <table width="100%" border="0" cellspacing="0" cellpadding="0">
                 <tr>
                   <td width="25" align="right"><input name="dns_features" type="radio" value="1" id="dns_features1"></td>
                   <td onClick="document.getElementById('dns_features1').click();">Set my domain as a DNS, a mail server &amp; to open my template <span class="red" style="font-size:9px;">(recommended)</span></td>
                 </tr>
                 <tr>
                   <td align="right"><input name="dns_features" type="radio" value="2" id="dns_features2"></td>
                   <td onClick="document.getElementById('dns_features2').click();">Set my domain as a DNS &amp; a mail server</td>
                 </tr>
                 <tr>
                   <td align="right"><input name="dns_features" type="radio" value="3" id="dns_features3"></td>
                   <td onClick="document.getElementById('dns_features3').click();">Set my domain as a DNS</td>
                 </tr>
               </table>
               </td>
             </tr>
           </table>
       </div>
       <div id='nmngdns' style='display:none'>
       	<?php // by paz - patch za razlichni tekstove v zavisimost ot tova dali reseller-a ima cluster ili ne
		if (!$private_dns) { ?>
           <table class="selected_dns" width="260" border="0" cellspacing="0" cellpadding="0">
             <tr>
               <td style="padding:7px;"><p><strong><span class="red"><? echo $domain_name; ?></span> will direct visitors to my template only!</strong></p>
                 <p>If you wish, at a later stage you can create at any time your own Private DNS (ns1.<? echo $domain_name; ?>, ns2.<? echo $domain_name; ?>) and an SMTP/POP3/IMAP email server (mail.<? echo $domain_name; ?>).</p></td>
             </tr>
           </table>
       </div>
       <? } // end paz?>               </td></tr></table>
   </div>
   <div id="dns_settings" style="display:block;">
       <p><strong>Choose a name server type:</strong><br />
           Choose how your name server will be set up: <strong>NS1/NS2</strong> or <strong>DNS1/DNS2</strong></p>
       <div style="padding-left:20px;"><br />
           <table class="selected_dns" id="tbl_ns1" width="260" border="0" cellspacing="0" cellpadding="0">
             <tr onClick="document.getElementById('ns_type1').click();">
               <td width="20" align="center"><input type='radio' name='ns_type' id='ns_type1' value='ns1' onClick="selected_ns(this);"></td>
               <td><strong>NS1.<? echo strtoupper($domain_name);?></strong><br />
               <strong>NS2.<? echo strtoupper($domain_name);?></strong></td>
             </tr>
           </table>
           <br />
           <table class="notselected_dns" id="tbl_ns2" width="260" border="0" cellspacing="0" cellpadding="0">
             <tr onClick="document.getElementById('ns_type2').click();">
               <td width="20" align="center"><input type='radio' name='ns_type' id='ns_type2' value='ns2' onClick="selected_ns(this);"></td>
               <td><strong>DNS1.<? echo strtoupper($domain_name);?></strong><br />
               <strong>DNS2.<? echo strtoupper($domain_name);?></strong></td>
             </tr>
           </table>
           <br />
       </div>
       <!--<div style='display:none;'>
       <p><input align="absmiddle" type="checkbox" name="mail_server" id="mail_server" value="yes">
       Also set up <? echo $domain_name;?> as a mail server (POP3/SMTP) for my clients: <strong>MAIL.<? echo strtoupper($domain_name);?></strong></p>
       </div>-->
   </div>
   <? if(!in_array($domain_action, array('addmdns1','addmdns2'))){ ?>
   <p align="center"><input type="button" value="&laquo; Go Back" onClick="searchDomain(document.getElementById('params').value);">
   &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="NEXT &raquo; Set Mail Box" onClick="choosePlan(fetchForm());"></p>
   <? }else{ ?>           <p align="center"><input type="button" value="&laquo; Go Back" onClick="LoadPage('myDomains','');">
       &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="NEXT &raquo; Payment" onClick="renewalServices(fetchForm());"></p>
   <? } ?>
   <input type=hidden name=params id=params>
</form>
<br />